"use strict"
//获取游戏配置
module.exports = async function () {
    let time = this.get("time","int");
    let sid=this.get('sid','int')||0;
    let status=[1];
    let _access=this.get('access','string');
    let developModel = this.model.redis("develop",this.branch);
    let _isDev=await developModel.get(_access);
    if(_isDev){
        status.push(0);
        status.push(2);
    }  
    let query = {"status":{"$in":status},"cid":{"$lt":100}};
    if(time){
        query["upsert"] = {"$gt":time};
    }
    if(sid){
        query['$or']=[{'sid':[]},{'sid':sid}];
    }
    let option = {"multi":true,"dataType":"array"};
    let config = this.model.branch("config",this.branch);
    return config.find(query,option);
};